﻿using System;
using System.Collections.Generic;

namespace SBPweb.MediaCenter.Common.Collections
{

    public static class ListHelper
    {

        public static IList<TOutput> ConvertTo<TInput, TOutput>(IList<TInput> list, Converter<TInput, TOutput> converter)
        {
            TInput[] arrIn = new TInput[list.Count];
            list.CopyTo(arrIn, 0);
            TOutput[] arrOut = Array.ConvertAll<TInput, TOutput>(arrIn, converter);

            return new List<TOutput>(arrOut);
        }

    }

}
